package newsSystem.user;

//import newsSystem.Admin.AdminInfo;
//import newsSystem.Admin.AdminManager;
import newsSystem.dao.UserInfoJDBC;

import java.util.List;


public class UserPage {
    private static List<UserInfo> UserList;
    public static void main(String[] args) throws Exception {
//        调用UserJDBC方法
        UserInfoJDBC.UserJDBC();

//        调用AdminManager的get来测试添加函数,获取管理员数据
        getUserList();

    }
    public static void getUserList(){
        UserList= UserManager.getUserList();
        // 遍历管理员集合
        for (UserInfo user : UserList) {
            System.out.println("用户ID: " + user.getUserID()   + ", 用户密码: " + user.getUserPWD() + ", 用户名: " + user.getUserName() + ", 用户性别: " + user.getUserSex() + ", 身份证号: " + user.getIDCard()+ ", 电话号码: " + user.getPhone() + ", 地址: " + user.getAddress());
        }

    }

    // 通过构造函数传递 adminList
    public UserPage(List<UserInfo> adminList) {
        this.UserList = UserList;
    }

    // 或者通过方法传递 adminList
    public void setUserList(List<UserInfo> UserList) {
        this.UserList = UserList;
    }
}
